package com.web.transactionMonitor.controller;

import java.util.List;

import com.web.common.BaseResult;
import com.web.common.enums.BaseStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.web.transactionMonitor.entity.TransactionMonitor;
import com.web.transactionMonitor.service.TransactionMonitorService;

import io.swagger.annotations.Api;

@Api(value = "API - TransactionMonitorController",description = "transactionMonitor")
@RestController
@CrossOrigin
@RequestMapping("/transactionMonitor")
public class TransactionMonitorController {

    @Autowired
    private TransactionMonitorService transactionMonitorService;

    @RequestMapping(value = "/transactionMonitorList")
    public BaseResult<List<TransactionMonitor>> transactionMonitorList(@ModelAttribute TransactionMonitor tm){
    	List<TransactionMonitor> transactionMonitorList = transactionMonitorService.getTransactionMonitors(tm);
    	return new BaseResult<>(BaseStatus.SUCCESS.getCode(),transactionMonitorList);
    }

}
